package com.core.ingenium.model;

import java.io.Serializable;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@NamedQueries( { @NamedQuery(name = "Nivel.findAll", query = "select o from Nivel o") })
@Table(name = "\"nivel\"")
public class Nivel implements Serializable {
    @Column(name = "descripcion")
    private String descripcion;
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private int id;
    @OneToMany(mappedBy = "nivel")
    private List<CarreraNivel> lstCarreraNivel;

    public Nivel() {
    }

    public Nivel(String descripcion, int id) {
        this.descripcion = descripcion;
        this.id = id;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public List<CarreraNivel> getLstCarreraNivel() {
        return lstCarreraNivel;
    }

    public void setLstCarreraNivel(List<CarreraNivel> lstCarreraNivel) {
        this.lstCarreraNivel = lstCarreraNivel;
    }

    public CarreraNivel addCarreraNivel(CarreraNivel carreraNivel) {
        getLstCarreraNivel().add(carreraNivel);
        carreraNivel.setNivel(this);
        return carreraNivel;
    }

    public CarreraNivel removeCarreraNivel(CarreraNivel carreraNivel) {
        getLstCarreraNivel().remove(carreraNivel);
        carreraNivel.setNivel(null);
        return carreraNivel;
    }
}
